﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pgAMonit.aspx.cs" Inherits="EGuayas.Web.Aspx.pgAMonit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title><link  href="~/Resources/css/Style.css"  rel="stylesheet" />
    <!-- Load Ext JS --> <script src="../../../Resources/js/Global.js"></script>
    
</head>
<body>
    <form id="Form1" runat="server">       
  <ext:ResourceManager ID="ResourceManager1" runat="server" />
  <ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
  <Items>
       <%--:: Venana popup Archivos Licenciamiento--%> 
      
         <%--::Panel Tab Inicio--%>
        <ext:FormPanel ID="FormPanel1" runat="server" Region="Center" Layout="VBoxLayout" >
                    <LayoutConfig>
                            <ext:VBoxLayoutConfig Align="Stretch" />
                    </LayoutConfig>
            <TopBar> 
                          <ext:Toolbar ID="Toolbar1" runat="server">
                                        <Items> 
                                             <ext:ToolbarFill />
                                            <ext:Button ID="ShowTab1" runat="server" Text="Mostrar Documentos" Disabled="true" Icon="PageWhiteStack">
                                                <Listeners>
                                                    <Click Handler="#{TabPanel1}.addTab(#{Tab1},0);this.setDisabled(true);" />
                                                </Listeners>
                                            </ext:Button>
                                           <ext:Button ID="ShowTab2" runat="server" Text="Mostrar Informe" Icon="PagePaste">
                                                <Listeners>
                                                    <Click Handler="#{TabPanel1}.addTab(#{Tab2},1);this.setDisabled(true);" />
                                                </Listeners>
                                            </ext:Button>
                                             <ext:Button ID="ShowTab3" runat="server" Text="Mostrar Tareas"  Icon="Wrench">
                                                <Listeners>
                                                    <Click Handler="#{TabPanel1}.addTab(#{Tab3},2);this.setDisabled(true);" />
                                                </Listeners>
                                            </ext:Button>
                                        </Items>
                                    </ext:Toolbar>
                     </TopBar>
                    <Items>
                    <ext:TabPanel ID="TabPanel1" runat="server" Flex="1"  TabPosition="Left">
                                <Items>
                                    <%--::Archivos Licenciamiento--%> 
                                     <ext:Panel ID="Panel1" Title="Documentos" runat="server" Closable="true" CloseAction="Hide"  Icon="PageWhiteStack"  Layout="Fit">
                                            <Items>
                                            <%--::Archivos Licenciamiento--%> 
                                            <ext:UserControlLoader  ID="wucCorreguirDoc_A005" UserControlID="wuc_corregdoc_monit_a005"  runat="server" Path="~/Auditoria/Admin/wucCorreguirDoc.ascx" OnComponentAdded="OnCorrDocMonAdded" />                        
                                            </Items>
                                        <Listeners> 
                                              <Close Handler="#{ShowTab1}.setDisabled(false);" />                                       
                                        </Listeners>
                                    </ext:Panel>               
                                    <%--::--%> 
                                    <ext:Panel ID="Tab2" Title="Informe" runat="server" Closable="true" CloseAction="Hide"  Icon="PagePaste" Layout="Fit">
                                        <Items>    
                                           <ext:UserControlLoader ID="uc_correginfodoc_c002" UserControlID="wuc_correginfodoc_bor_c02" runat="server" Path="~/Auditoria/admin/wucInformePmaMon.ascx" OnComponentAdded="OnInformeAdded" />                  
                                           <%--
                                            <ext:Panel 
                                            ID="pnlPackEnd" 
                                            runat="server"
                                            Title="Informe"
                                            Icon="Spellcheck"
                                            Layout="HBoxLayout"
                                            BodyPadding="5">
                                            <Defaults>
                                                <ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
                                            </Defaults>
                                            <LayoutConfig>
                                                <ext:HBoxLayoutConfig Align="Middle" Pack="End" />
                                            </LayoutConfig>
                                            <Items>
                                                     <ext:ComboBox ID="ComboBox3" 
                                                        LabelWidth="185"
                                                        runat="server"
                                                        FieldLabel="Calificación Informe"
                                                        Name="Catg"                                                  
                                                        EmptyText="Seleccione categoria">
                                                        <Items>
                                                            <ext:ListItem Text="Aprobado" Value="OH1" />
                                                            <ext:ListItem Text="Corregido" Value="OH2" />
                                                        </Items>
                                                    </ext:ComboBox>
                                         </Items>
                                         </ext:Panel>
                                         --%> 
                                        </Items>
                                        <Listeners>
                                                <Close Handler="#{ShowTab2}.setDisabled(false);" />
                                         </Listeners>
                                     </ext:Panel>
                                    <%--::Tareas--%> 
                                    <ext:Panel ID="Tab3" Title="Tareas" runat="server" Closable="true" CloseAction="Hide"  Icon="Wrench" Layout="Fit">
                                        <Items> 
                                            <ext:UserControlLoader ID="wuc_tarea_A005"  UserControlID="wuc_tareamon_a005"  runat="server" Path="~/Auditoria/Admin/wucTareas.ascx" OnComponentAdded="OnTareasAdded" />                                       
                                         </Items>
                                        <Listeners>
                                                    <Close Handler="#{ShowTab3}.setDisabled(false);" />
                                         </Listeners>
                                     </ext:Panel>

                                      </Items>
                               <Bin></Bin>                       
                        </ext:TabPanel>
                   </Items>
                   <BottomBar>
                     <ext:StatusBar 
                            ID="StatusBar2" 
                            runat="server"
                            StatusAlign="Left">
                            <Items>                                
                                <ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="" Cls="ux-bold-text-item"  Margin="15"/>
                            </Items>
                        </ext:StatusBar>
                    </BottomBar>
       </ext:FormPanel>
       <%--
       <ext:Window 
            ID="winVisor" 
            runat="server"            
            Icon="Zoom"
            Height="185" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="FormPanel4" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                    <FieldDefaults LabelWidth="75" LabelPad="20" LabelSeparator="" />
                    <Items>   </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnWinComentariOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                  <ext:Button ID="Button5" runat="server" Text="Aceptar"  OnClientClick="AppGlobalJs.closeWin(#{winVisor})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelComentario}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>
      
       <ext:Window 
            ID="winObs" 
            runat="server"            
            Icon="PageFind"
            Height="185" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true"
            closeaction="Hide">
            <Content>
                <ext:FormPanel ID="forPanelObs"                   
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                    <FieldDefaults LabelWidth="75" LabelPad="20" LabelSeparator="" />
                    <Items>   
                         <ext:Panel ID="Panel3" runat="server" Border="false" Layout="Form" ColumnWidth=".5" LabelAlign="Top">
                            <Defaults>
                                <ext:Parameter Name="AllowBlank" Value="false" Mode="Raw" />
                                <ext:Parameter Name="MsgTarget" Value="side" />
                            </Defaults>
                            <Items> 
                                <ext:ComboBox ID="ComboBox1" 
                                    runat="server"
                                    Width="250"
                                    Editable="false"
                                    DisplayField="state"
                                    FieldLabel="Categoria"
                                    ValueField="abbr"
                                    TypeAhead="true" 
                                    QueryMode="Local"
                                    ForceSelection="true"
                                    TriggerAction="All"
                                    EmptyText="Seleccione a categoria"
                                    SelectOnFocus="true">                        
                                    <Store>
                                        <ext:Store ID="stoCateg" runat="server">
                                            <Model>
                                                <ext:Model ID="Model6" runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="abbr" />
                                                        <ext:ModelField Name="state" />
                                                        <ext:ModelField Name="nick" />
                                                     </Fields>
                                                </ext:Model>
                                            </Model>            
                                        </ext:Store>
                                    </Store>
                                    <ListConfig>
                                        <ItemTpl ID="ItemTpl1" runat="server">
                                            <Html>
						                        <div class="list-item">
							                            <h3>{state}</h3>
							                            {nick:ellipsis(15)}
						                        </div>
				                            </Html>    
                                        </ItemTpl>
                                    </ListConfig>
                                </ext:ComboBox> 
                                <ext:TextArea FieldLabel="Observación"  AnchorHorizontal="90%" AnchorVertical="100%"></ext:TextArea>
                            </Items>
                        </ext:Panel>
                    </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnWinObsOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                <ext:Button ID="btnWinObsOk" runat="server" Text="Aceptar"  Disabled="true"
                    FormBind="true">
                    <Listeners>
                        <Click Handler="if (#{forPanelObs}.getForm().isValid()) {Ext.Msg.alert('Aviso', 'Almaceno Exitosamente!');AppGlobalJs.closeWin(#{winObs});}
                            else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: 'FormPanel es incorrecto', buttons:Ext.Msg.OK});}" />
                    </Listeners>
                </ext:Button>
                <ext:Button ID="Button6" runat="server" Text="Cancelar"  OnClientClick="AppGlobalJs.closeWin(#{winObs})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelObs}.getForm().reset();"></BeforeHide>              
            </Listeners>
       </ext:Window>
       <ext:Window 
            ID="winAddInforme" 
            runat="server"            
            Icon="ReportEdit"
            Height="200" 
            Width="350"
            ButtonAlign="Center"
            BodyStyle="background-color: #fff;" 
            BodyPadding="5"            
            hidden="true" 
            closeaction="Hide">
            <Content>
                <ext:FormPanel 
                    ID="forPanelDoc" 
                    Border="false"
                    runat="server"
                    Width="330"            
                    BodyPadding="5"
                    Layout="Form">
                     <Defaults>
                <ext:Parameter Name="anchor" Value="95%" Mode="Value" />
                <ext:Parameter Name="allowBlank" Value="false" Mode="Raw" />
                <ext:Parameter Name="msgTarget" Value="side" Mode="Value" />
            </Defaults>
            <Items>
                <ext:TextField ID="PhotoName" runat="server" FieldLabel="Nombre" />
                <ext:FileUploadField 
                    ID="FileUploadField1" 
                    runat="server" 
                    EmptyText="Seleccione documento"
                    FieldLabel="Documento"
                    ButtonText=""
                    Icon="ImageAdd"
                    />
                <ext:TextArea ID="TextArea1" runat="server" FieldLabel="Descripción" />
                </Items>
                    <Listeners>
                        <ValidityChange Handler="#{btnWinDocOk}.setDisabled(!valid);" />
                    </Listeners>
                </ext:FormPanel>
            </Content>
            <Buttons>
                  <ext:Button ID="btnWinDocOk" runat="server" Text="Aceptar" Disabled="true">
                    <DirectEvents>
                        <Click 
                            OnEvent="UploadClick"
                            Before="if (!#{forPanelDoc}.getForm().isValid()) { return false; } 
                                Ext.Msg.wait('Uploading your photo...', 'Uploading');"
                                
                            Failure="Ext.Msg.show({ 
                                title   : 'Error', 
                                msg     : 'Error during uploading', 
                                minWidth: 200, 
                                modal   : true, 
                                icon    : Ext.Msg.ERROR, 
                                buttons : Ext.Msg.OK 
                            });">
                          <EventMask ShowMask="True"></EventMask>
                        </Click>
                    </DirectEvents>
                </ext:Button>
                  <ext:Button ID="btnWinClose" runat="server" Text="Aceptar"  OnClientClick="AppGlobalJs.closeWin(#{winAddInforme})">
                    <Listeners>                     
                    </Listeners>
                </ext:Button>
            </Buttons>
            <Listeners>
                <BeforeHide Handler="#{forPanelDoc}.getForm().reset();"></BeforeHide>              
            </Listeners>
        </ext:Window>
        --%>  
      </Items>
   </ext:Viewport>
    <ext:XScript ID="XScript1" runat="server">
    <script language="javascript" type="text/javascript">
        var pgFn = new Object();
        pgFn.presentaMensaje=true;
        pgFn.PrepareProrroga = function (grid, command, record, row, col, value) {

            if (value == "NO") {
                if (command.command == "Prorroga") {
                    command.hidden = true;
                    command.hideMode = "visibility";
                }

            }
            else {

                if (command.command == "Prorroga") {
                    command.hidden = false;
                    command.hideMode = "display";
                }


            }

        };
        pgFn.Test = function() {
            alert("OK");
        };
        AppGlobalJs.showWin = function (objwin) {
            objwin.show();
        };
        AppGlobalJs.closeWin = function(objwin) {
            objwin.hide();
        };
        pgFn.menuItemClick = function (menu, item) {
            App.PnlCenter.body.update(Ext.String.format("Clicked: {0}", item.text)).highlight();
        };
 </script>
</ext:XScript>     
</form>
</body>


</html>
